import entity.NPCContext;
import java.util.Scanner;

public class SetUp {

    private static final NPCContext npcContext = new NPCContext();
    private static final Scanner scanner = new Scanner(System.in);
    public static void main(String[] args) throws Exception{
        System.out.println("欢迎来到Fairy的世界！");
        while(true){
            System.out.println("请选择与Fairy的交互：");
            System.out.println("1. 与她对话");
            System.out.println("2. 谄媚她");
            System.out.println("3. 咒骂她");
            System.out.println("4. 与她交换装备");
            System.out.println("5. 给她礼物");
            System.out.println("6. 结束对话");
            System.out.print("你的输入:");
            String line = scanner.nextLine();
            int choice;
            try{
                choice = Integer.parseInt(line);
            }catch(Exception e){
                System.err.println("请输入数字！");
                continue;
            }

            switch (choice){
                case 1:
                    npcContext.talkTo();
                    break;
                case 2:
                    npcContext.flatterTo();
                    break;
                case 3:
                    npcContext.swearTo();
                    break;
                case 4:
                    npcContext.changeEquipmentTo();
                    break;
                case 5:
                    npcContext.giveGiftTo();
                    break;
                case 6:
                    System.exit(0);
                default:
                    System.err.println("请输入1-5的数字！");
            }

            System.out.println();
            Thread.sleep(200);
        }

    }
}
